﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace diploma.core.data.objects
{
    public class Question : DataObject
    {
        public Question(long id, string _content)
            : base(id, _content)
        {
            properties = new List<Property>();
        }

        public string Content
        {
            get
            {
                return textField;
            }
        }

        public void SetContent(string _value, bool _innerDataSourceChanges)
        {
            SetTextField(_value, _innerDataSourceChanges);
        }

        public void SetContent(string _value)
        {
            SetTextField(_value);
        }

        public override DataObjectTypes Type
        {
            get
            {
                return DataObjectTypes.Question;
            }
        }

        private List<Property> properties;
        public List<Property> Properties
        {
            get
            {
                return properties;
            }
        }
        public void AddProperties(IEnumerable<Property> _properties)
        {
            properties = new List<Property>(_properties);
            DataRouter.Instance.Act(DataActions.update, this.Type, this);
        }

        public void AddProperty(Property _property)
        {
            AddProperties(new Property[] { _property });
        }
    }
}
